import Taro from '@tarojs/taro'
import React from 'react'
import { View, Text, Image } from '@tarojs/components'
import { formatDate } from '@src/utils/dateTimeUtil'
import imgList from '@components/imgList'

function NoticeItem ({value}) {
  return <View className="noticeItem">
    <View className="title">
      <Text>{value.title}</Text>
      <Text className="time">{formatDate(parseInt(value.time), 'YYYY-MM-DD HH:mm')}</Text>
    </View>
    <View className="content">
      <Text>{value.content}</Text>
    </View>
    {
      value.detail &&
      <View className="bottom" onClick={() => Taro.showToast({title: value.detail})}>
        <Text>查看更多</Text>
        <Image className='icon' src={imgList.rightIcon}></Image>
      </View>
    }
  </View>
}

export default NoticeItem
